<template>
  <div class="hud-body">
    <el-dialog :visible.sync="dialogTableVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape='false' width="160px" >
      <div class="content">
        <el-progress type="circle" :percentage="rate"></el-progress>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name:"progressHud",
  props:{
    rate:{
      type:Number,
      default:0
    }
  },
  data(){
    return{
      dialogTableVisible:false
    }
  },
  watch:{
    rate:{
      handler(newVal,oldVal){
        if (newVal === 100){
          setTimeout(()=>{
            this.hiddenHud();
          },1000)
        }
      }
    }
  },
  methods:{
    openHud(){
      this.dialogTableVisible = true;
    },
    hiddenHud(){
      this.dialogTableVisible = false;
    }

  }
}



</script>
<style scoped>
.content{
  display: flex;
  align-items: center;
  justify-content: center;;
}
.hud-body ::v-deep .el-dialog__header{
  padding: 0;
}
.hud-body ::v-deep .el-dialog:not(.is-fullscreen){
  margin-top: 24vh !important;
}
</style>
